package com.mentalhealthplatform.studentV3.service;

import com.mentalhealthplatform.appModels.Lecture;
import com.mentalhealthplatform.studentV3.repository.LectureRepositoryV3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class LectureServiceV3 {

    @Autowired
    private LectureRepositoryV3 lectureRepositoryV3;


    public List<Lecture> findAll() {
        return lectureRepositoryV3.findAll();
    }

    public Optional<Lecture> findById(Long id) {
        return lectureRepositoryV3.findById(id);
    }

    public Lecture save(Lecture lecture) {
        return lectureRepositoryV3.save(lecture);

    }

    public void deleteById(Long id) {
        lectureRepositoryV3.deleteById(id);
        //lectureElasticsearchRepository.deleteById(id);
    }

}